package com.bum.api.processor.ghep.bo;

import org.apache.commons.lang.StringUtils;

import com.bum.api.core.exp.om.Metas;
import com.bum.api.core.exp.om.Params;
import com.bum.api.core.html.HtmlModel;
import com.bum.api.core.html.HtmlRender;

public class GhepHtmlBO {
	HtmlRender	htmlRender;

	// bói http://me.zing.vn/zb/dt/tho210_kuteqn/17446372
	public String ghepTen(String path, Params params, Metas metas) {
		HtmlModel model = HtmlModel.get(metas);

		String me = StringUtils.trimToNull(params.getValue("me"));
		String you = StringUtils.trimToNull(params.getValue("you"));

		model.put("me", me);
		model.put("you", you);

		if (StringUtils.isNotBlank(me) && StringUtils.isNotBlank(you)) {
			String img = me.substring(0, 1) + "_" + you.substring(0, 1);
			img = "http://cdn.bum.vn/ghep-ten/" + img.toLowerCase() + "00000.jpg";
			model.put("img", img);
		}

		return htmlRender.render("ghep/ghep-ten", model);
	}

	public void setHtmlRender(HtmlRender htmlRender) {
		this.htmlRender = htmlRender;
	}
}
